package com.sxhuayuan.parking.plugin.parking.dahua;

import com.alibaba.fastjson.JSONObject;
import com.sxhuayuan.parking.dto.ParkFeeCacheBean;
import com.sxhuayuan.parking.entity.ParkChannel;
import com.sxhuayuan.parking.entity.ParkingIn;
import com.sxhuayuan.parking.entity.ParkingLot;
import com.sxhuayuan.parking.plugin.parking.dahua.request.DaHuaBeforehandFeeRequest;
import com.sxhuayuan.parking.plugin.parking.dahua.result.DaHuaResult;
import com.sxhuayuan.parking.service.*;
import com.sxhuayuan.parking.service.impl.pojo.ExitingCar;
import com.sxhuayuan.parking.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;

@RestController
@RequestMapping("/daHuaNotify")
public class DaHuaNotifyController {

	private Logger log = LoggerFactory.getLogger(this.getClass());

	/**
	 * 大华车厂推送 车厂签到接口
	 * @return json
	 */
	@PostMapping("/signIn")
	public String signIn(HttpServletRequest request) {
		String decodeJson = DaHuaUtils.decodeRequest(request);
		log.debug("大华车厂签到 json = {}", decodeJson);
		JSONObject req = new JSONObject();
		req.put("interval", "24");
		req.put("token", "token");
		return DaHuaResult.successJson(req);
	}
}